<%@ page import="java.util.ArrayList" %>
<%@ page import="inspur.entity.BookObject" %>
<%@ page import="inspur.dao.BookDao" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/10/22
  Time: 19:46
  网站主页
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="config.jsp"%>
<html>
<head>
    <title><%=webTitle%></title>
    <meta name="Keywords" content="<%=keywords%>">
    <meta name="Description" content="<%=Description%>">
    <link rel="stylesheet" href="css/style.css">
    <!--网站的ICO图标-->
    <link rel="shortcut icon" href="/favicon.ico"/>
    <link rel="bookmark" href="/favicon.ico"/>
    <script>
        //向console输出信息
        console.log("诚挚的邀请你加入我们，虽然目前只有我一个人在维护这个网站，但是还是希望更多的人能够参入进来");
        console.log("代码改善的建议，代码bug请反馈至：hyfree521@qq.com,标题：bug反馈-FormConsole");
    </script>
</head>
<body>
    <div align="center">
        <%@include file="component/top.jsp"%><!---顶栏-->
        <%@include file="component/checkBox.jsp"%><!--搜索框-->
        <%@include file="component/navigationPage.jsp"%><!--导航组件--->

        <div  id="table" style="width: 1000px;margin: 0 auto;border: 0px solid green">
            <p class="t2g">检索结果如下：</p>

            <hr>
            <table style="width:1000px;">
                <tr>
                    <td width="200px " valign="top"><p>书籍名称：</p></td>
                    <td width="200px" valign="top"> <p>书籍出版社：</p></td>
                    <td valign="top"><p>书籍介绍：</p></td>
                </tr>


                <%
                    ArrayList<BookObject> ay;
                    String keyword=request.getParameter("keyword");
                    String press=request.getParameter("press");
                    if (keyword==null){
                        if (press==null){
                            press="浪潮优派出版社";
                            ay=BookDao.SelectBookByPress(press);

                        }else{
                            System.out.println(press);
                            ay=BookDao.SelectBookByPress(press);
                        }
                    }else{
                             ay= BookDao.SelectBookByKeyWord(keyword);
                     }

                    for (BookObject a:ay
                            ) {
                        out.print("<tr>");
                        out.println("<td><a class='a2' href='book.jsp?id="+a.getId()+"'>"+a.getBookName()+"</p></td>");
                        out.println("<td><a class='a2' href='check_result.jsp?press="+a.getPress()+"'>"+a.getPress()+"</p></td>");
                        out.println("<td><a class='a2' href=''>"+a.getIntroduction()+"</p><br></td>");
                        out.print("</tr>");


                    }
                %>
            </table>
            <hr>
        </div>

    </div>
</body>
</html>
